package com.owen.springboot.redis.producer.controller;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class SendMessageController {

    @Resource
    private RedisTemplate redisTemplate;

    @RequestMapping("/sendData")
    public String sendData(String message){

        redisTemplate.convertAndSend("test",message);

        return message;
    }

}
